broadway: destroy old surface before creating new one
authorAlexander Larsson <alexl@redhat.com>
Wed, 3 Apr 2013 13:46:21 +0000 (15:46 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 3 Apr 2013 13:58:40 +0000 (15:58 +0200)
We were not using the old one anyway, and this may in some cases
use less memory (although in most cases the server has a ref to the
surface anyway).

gdk/broadway/gdkwindow-broadway.c

index 103f09187b852d05b8e20dfa527f76fc6c94442d..3784b5a57c465607e0e0997aed577db7b257a8e7 100644 (file)
@@ -271,16 +271,13 @@ void
 _gdk_broadway_window_resize_surface (GdkWindow *window)
 {
   GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
-  cairo_surface_t *old;
 
   if (impl->surface)
     {
-      old = impl->surface;
+      cairo_surface_destroy (impl->surface);
 
       impl->surface = _gdk_broadway_server_create_surface (gdk_window_get_width (impl->wrapper),
                                                           gdk_window_get_height (impl->wrapper));
-
-      cairo_surface_destroy (old);
     }
 
   if (impl->ref_surface)